<?php include_once "top.php";?>
<div class="addleft">
	<a href="shop_edit.php">添加店铺</a>
</div>
<div class="addbar">
	<ul>
	<h2>添加店铺</h2>
	<form method="post" action="ra.php" onsubmit="return checkForm()" enctype="multipart/form-data">
		<li><label>选择城市：</label>
			<select id="city_id" name="city_id" class="ipt" style="min-width:100px;width:auto;height:24px">
				<option value="0">选择城市</option>
				<?php foreach($db->ig2_select('mae_city','1') as $list){?>
				<option value="<?php echo $list['id']?>"><?php echo $list['name']?></option>
				<?php }?>
			</select>
		</li>
		<li><label>店铺编码：</label><input id="code" type="text" name="code" value="" class="ipt" /></li>
		<li><label>店铺名称：</label><input id="name" type="text" name="name" value="" class="ipt" /></li>
		<li style="border:none"><label>&nbsp;</label><input type="submit" name="add_shop" value="添加店铺" /></li>
	</form>
	</ul>
</div>
<script language="javascript">
function checkForm(){
	if(document.getElementById('city_id').value==0){
		alert('请选择城市');
		return false;
	}
	if(document.getElementById('code').value==''){
		alert('请输入店铺编码');
		return false;
	}
	if(document.getElementById('code').value>90000 && document.getElementById('code').value<100000){
		alert('店铺编码不能为90000~100000之间');
		return false;
	}
	if(document.getElementById('name').value==''){
		alert('请输入店铺名称');
		return false;
	}
	return true;
}
</script>
<?php include_once "down.php";?>